home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
windows
/
wdj1096.zip
/
OTALA.ZIP
/
TASKHELP.CPP
< prev
Wrap
C/C++ Source or Header
|
1996-07-03
|
515b
|
27 lines
#include <windows.h>
#include <toolhelp.h>
HMODULE ModuleFromTask(HTASK hTask)
{
TASKENTRY te;
te.dwSize = sizeof(te);
if (TaskFindHandle(&te, hTask))
return (te.hModule);
return (NULL);
}
HTASK TaskFromInstance(HINSTANCE hInstance)
{
TASKENTRY te;
te.dwSize = sizeof(te);
BOOL fLoop = TaskFirst(&te);
while (fLoop)
{
if (te.hInst == hInstance)
return (te.hTask);
fLoop = TaskNext(&te);
}
return (NULL);
}